package com.zzw.design.command;

/**
 * @author zzw
 * @see
 * @since 2018/3/21
 */
public class FunctionSettingButton {

    private String name; //功能键名称
    private Command command; //维持一个抽象命令对象的引用

    public FunctionSettingButton(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }

    //为功能键注入命令
    public void setCommand(Command command) {
        this.command = command;
    }

    //发送请求的方法
    public void onClick() {
        System.out.println("点击功能键：");
        command.execute();
    }
}
